//
// GPSMapEdit
// (c) Konstantin Galichsky (kg@geopainting.com), 2002-2005
//
// The helper to select color.
//

# include "StdAfx.h"
# include "SelectColor.h"

bool SelectColor (HWND _hWnd, COLORREF & _rgb) {
	COLORREF acrCustClr [16];
	memset (acrCustClr, 0, sizeof (acrCustClr));

	CHOOSECOLOR cc;
	::memset (& cc, 0, sizeof (cc));
	cc.lStructSize  = sizeof (cc);
	cc.Flags        = CC_FULLOPEN | CC_RGBINIT | CC_ANYCOLOR;
	cc.hwndOwner    = _hWnd;
	cc.lpCustColors = (LPDWORD) acrCustClr;
	cc.rgbResult    = _rgb;
	if (::ChooseColor (& cc)) {
		_rgb = cc.rgbResult;
		return true;
	}
	return false;
}
